/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "docente")
@NamedQueries({
    @NamedQuery(name = "Docente.findAll", query = "SELECT d FROM Docente d"),
    @NamedQuery(name = "Docente.findByNDcnId", query = "SELECT d FROM Docente d WHERE d.nDcnId = :nDcnId"),
    @NamedQuery(name = "Docente.findByVCodigo", query = "SELECT d FROM Docente d WHERE d.vCodigo = :vCodigo"),
    @NamedQuery(name = "Docente.findByVEstado", query = "SELECT d FROM Docente d WHERE d.vEstado = :vEstado")})
public class Docente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nDcnId")
    private Integer nDcnId;
    @Column(name = "vCodigo")
    private String vCodigo;
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(mappedBy = "nDcnId")
    private List<Docentexclase> docentexclaseList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "docente")
    private List<Docentexperiodo> docentexperiodoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "docente")
    private List<Docentexciclo> docentexcicloList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "docente")
    private List<Docentexcategoria> docentexcategoriaList;
    @JoinColumn(name = "nPrsId", referencedColumnName = "nPrsId")
    @ManyToOne(optional = false)
    private Persona nPrsId;

    public Docente() {
    }

    public Docente(Integer nDcnId) {
        this.nDcnId = nDcnId;
    }

    public Integer getNDcnId() {
        return nDcnId;
    }

    public void setNDcnId(Integer nDcnId) {
        this.nDcnId = nDcnId;
    }

    public String getVCodigo() {
        return vCodigo;
    }

    public void setVCodigo(String vCodigo) {
        this.vCodigo = vCodigo;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Docentexclase> getDocentexclaseList() {
        return docentexclaseList;
    }

    public void setDocentexclaseList(List<Docentexclase> docentexclaseList) {
        this.docentexclaseList = docentexclaseList;
    }

    public List<Docentexperiodo> getDocentexperiodoList() {
        return docentexperiodoList;
    }

    public void setDocentexperiodoList(List<Docentexperiodo> docentexperiodoList) {
        this.docentexperiodoList = docentexperiodoList;
    }

    public List<Docentexcategoria> getDocentexcategoriaList() {
        return docentexcategoriaList;
    }

    public void setDocentexcategoriaList(List<Docentexcategoria> docentexcategoriaList) {
        this.docentexcategoriaList = docentexcategoriaList;
    }
    
    public List<Docentexciclo> getDocentexcicloList() {
        return docentexcicloList;
    }

    public void setDocentexcicloList(List<Docentexciclo> docentexcicloList) {
        this.docentexcicloList = docentexcicloList;
    }

    public Persona getNPrsId() {
        return nPrsId;
    }

    public void setNPrsId(Persona nPrsId) {
        this.nPrsId = nPrsId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nDcnId != null ? nDcnId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Docente)) {
            return false;
        }
        Docente other = (Docente) object;
        if ((this.nDcnId == null && other.nDcnId != null) || (this.nDcnId != null && !this.nDcnId.equals(other.nDcnId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Docente[ nDcnId=" + nDcnId + " ]";
    }
    
}
